package com.changgou.listener;

import com.changgou.config.RabbitmqConfig;

import com.changgou.service.ESManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class GoodsUpListener {

    @Autowired
    private ESManagerService esManagerService;

    @RabbitListener(queues = RabbitmqConfig.SEARCH_UP_QUEUE)
    public void receiveMessage(String spuId) {
        System.out.println("接收的消息为:" + spuId);

        //将监听到的spuId传递到业务层进行处理
        esManagerService.importDataToEsByspuId(spuId);
    }



}
